<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html class=" -webkit-">
<head>
	<meta charset="utf-8">
    <title>杰利联合</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
	<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/jiu/css/mobile_module.css?v=1493085388" media="all">
    <script type="text/javascript" src="${ctxStatic}/jiu/js/jquery-2.0.3.min.js"></script>
	<script type="text/javascript" src="${ctxStatic}/jiu/js/prefixfree.min.js?v=1493085388"></script>
	<script type="text/javascript" src="${ctxStatic}/jiu/js/dialog.js?v=1493085388"></script>
	<script type="text/javascript" src="${ctxStatic}/jiu/js/flipsnap.min.js?v=1493085388"></script>
	<script type="text/javascript" src="${ctxStatic}/jiu/js/mobile_module.js?v=1493085388"></script>
	<link href="${ctxStatic}/jiu/css/common.css?v=1493085388" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script type="text/javascript">
			wx.config({
			    debug: false,
			    appId: '${weChatAppId}',
			    timestamp: '${timestamp}',
			    nonceStr: '${nonceStr}',
			    signature: '${signature}',
			    jsApiList: [
			      'checkJsApi',
			      'closeWindow',
			    ]
			});
			
			function closehh(){
				wx.closeWindow();
			}
	</script>
	<style>
				
			.yin{
				
				background-color:rgba(0, 0, 0, 0.5);								
				width: 100%;
				height: 100%;								
				position: fixed;
				top: 0;
				left: 0;
				z-index: 9999;
				display: none;
			}
			.loading{
				line-height: 50px;
				width: 200px;
				height: 50px;
				display: none;
				background-color: rgba(23, 21, 21, 0.51);
				position: fixed;
				top: 50%;
				left: 50%;
				margin: -25px 0 0 -100px;
				z-index: 10000;				
				border-radius: 5px;
				-webkit-border-radius: 5px;
				color: #fff;
				text-align: center;
			}
		</style>
</head>

<body>
<div class="container">
  <!-- 订单信息 -->
  <div class="order_info">
    <p class="t">订单编号：${jiuRechargeLog.orderNo}</p>
	<p class="t">门店：${jiuRechargeLog.storeName}</p>
	<p class="t">门店电话：${jiuStore.phone}</p>
	<p class="t">充值金额：${jiuRechargeLog.money}</p>
	<p class="t">充值积分：${jiuRechargeLog.point}</p>
	<p class="t">时间：<fmt:formatDate value="${jiuRechargeLog.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/> </p>
    <ul>
          </ul>
    <p class="order_remark">
      <textarea placeholder="填写取消原因" name="remark" id="remarks"></textarea>
    </p>
	<input type="hidden" name="order_number" value="20170425095322ac12cc6bd">
	<input type="hidden" name="order_id" value="8905">
    <a class="btn" href="javascript:void(0)" onclick="chongzhi(${jiuRechargeLog.id})">确认订单</a><br>
    <%-- <a class="btn" href="javascript:void(0)" onclick="apply(${jiuRechargeLog.id})">修改订单</a><br> --%>
 	 	<a style="margin-bottom: 10px;" class="btn blue_btn" href="javascript:void(0)" onclick="revoke(${jiuRechargeLog.id})">取消订单</a>

  </div>
		 
</div>
		<div class="yin">
		</div>
		<div class="loading" >			
			 <img alt="" src="${ctxStatic}/jiu/img/icon32_loading_dark.gif">正在提交，请稍后...	
		</div>


<script>
	window.alert = function(name){
	  var iframe = document.createElement("IFRAME");
	  iframe.style.display="none";
	  iframe.setAttribute("src", 'data:text/plain,');
	  document.documentElement.appendChild(iframe);
	  window.frames[0].window.alert(name);
	  iframe.parentNode.removeChild(iframe);
	 };
	 
	 window.confirm = function (message) {
	   var iframe = document.createElement("IFRAME");
	   iframe.style.display = "none";
	   iframe.setAttribute("src", 'data:text/plain,');
	   document.documentElement.appendChild(iframe);
	   var alertFrame = window.frames[0];
	   var result = alertFrame.window.confirm(message);
	   iframe.parentNode.removeChild(iframe);
	   return result;
	 };
	
		var tag=0;
		function chongzhi(id){
			if(tag==1){
				return false;
			}
			tag=1;
			
			 $.getJSON("${ctxFront }/jiu/chongzhiF",{id:id}, function(data){
                 alert(data.message);
                 closehh();
            });
		}
		
		function revoke(id){
			if(tag==1){
				return false;
			}
			var remarks=$('#remarks').val();
			tag=1;
			$.ajax({
				type: 'POST',
				url: "${ctxFront }/jiu/revokeF",
				dataType: "json",
				cache:true,
				async:false,
				data: {id:id,remarks:remarks},
				success: function (data) {
					alert(data.message);
	                closehh();
				}
			});
			/* $.getJSON("${ctxFront }/jiu/revokeF",{id:id,remarks:remarks}, function(data){
                 alert(data.message);
                 closehh();
            }); */
			
		}
		
		function apply(id){
			if(tag==1){
				return false;
			}
			tag=1;
			 $.getJSON("${ctxFront }/jiuApply/applyChongZhi",{id:id}, function(data){
			
                 alert(data.message);
                 closehh();
            });
		}
		
	</script>
</body>
</html>
